package com.atguigu.spzx.manager.service.impl;

import com.atguigu.spzx.common.utils.BeanUtils;
import com.atguigu.spzx.manager.entity.ProductUnit;
import com.atguigu.spzx.manager.mapper.ProductUnitMapper;
import com.atguigu.spzx.manager.service.ProductUnitService;
import com.atguigu.spzx.manager.vo.productUnit.ProductUnitQueryRespVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * ProductUnitServiceImpl
 * </p>
 *
 * @author flyduck
 * @since 2023/10/31
 */
@Service
public class ProductUnitServiceImpl implements ProductUnitService {
    @Autowired
    private ProductUnitMapper productUnitMapper;

    /**
     * 查询所有商品计量单位
     * @return
     */
    @Override
    public List<ProductUnitQueryRespVo> getProductUnitList() {
        List<ProductUnit> list = productUnitMapper.selectList(null);
        return BeanUtils.toBeanList(list,ProductUnitQueryRespVo.class);

    }
}
